home *** CD-ROM | disk | FTP | other *** search
- Path: ratty.wolfe.net!mcguire
- From: mcguire@wolfe.net (Mike McGuire)
- Newsgroups: comp.lang.c,comp.unix.programmer
- Subject: GCC 2.7.1 bug?
- Date: 11 Jan 1996 17:54:34 GMT
- Organization: Wolfe Internet Access, L.L.C.
- Message-ID: <4d3isq$ss@news1.wolfe.net>
- NNTP-Posting-Host: gonzo.wolfenet.com
- X-Newsreader: TIN [version 1.2 PL2]
-
- Greetings,
-
- First of all I would like to thank everyone for their suggestions to help me
- solve my SIGBUS problem. Well, I have solved the problem, but what I did
- seems unnecessary. I think there may be a compiler bug.
-
- The solution to get rid of my SIGBUS was to initialize a character
- pointer in its declaration, but the first use of the pointer is assigning
- a value to it, not dereferencing, or using its vaule.
-
- The original code:
-
- char *tmpfile;
- ...
- main() {
- ...
- tmpfile = mktemp( tmpname ); <=== SIGBUS!
-
-
- The solution:
-
- char *tmpfile = 0;
-
-
- I compiled the code using gcc 2.7.1 for m68k-hp-hpux9.10, with the
- -traditional option. A diff of the assembled code gives me :
-
- 42,45d41
- < .globl _tmpfile <=== The working version
- < .even <=== Is .even an alignment directive?
- < _tmpfile: <===
- < .long 0 <===
- 2879a2876
- > .comm _tmpfile,4 <=== Original, non-working version
-
-
- Any ideas why one works and one doesn't? I am just really curious at this
- point.
-
-
- Thanks a bunch,
-
- Mike
-